Skip to content

fix(id/web): unmatched backtick no longer disables newline-destination protection (#7557) - #8061

Merged
dezren39 merged 1 commit into
mainfrom
queue/14420-7557-code-span-blank-line
Nov 14, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/14420-7557-code-span-blank-line

Conversation

@dezren39

@dezren39 dezren39 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Fixes #7557 (queue task 14420).

protect_newline_destinations tracked an open inline code span that only an equal-length backtick run closed, carried across blank lines and every other block boundary to end of document. One stray/unmatched backtick in prose therefore disabled newline-destination protection for the rest of the document — the load/save link corruption the protection exists to prevent.

Fix (CommonMark oracle: an unmatched backtick run is literal text):

  • A backtick run now opens a span only when an equal-length run closes it within the same paragraph (code_span_closes_within_paragraph lookahead); paragraph end = blank line (whitespace-only lines count) or EOF.
  • Span state is also reset at a blank line in the line-start classification, so no residual state can cross a paragraph break.

Verification (on the laptop, pkgs/id):


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 9, 2026 19:04
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-09T19:04:37.421542Z
We couldn’t complete this review. Comment @codex review to try again.
d5f133e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b0c12b7f-0550-4bc6-a541-7ed225cb69d5
Commits

Reviewing files that changed from the base of the PR and between 230503d and cda1587.

Files selected for processing: 2

  • pkgs/id/crates/id-web/src/markdown.rs
  • pkgs/id/crates/id-web/src/markdown/parse_helpers.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

Agent note — task 17247 picked up (lane any-c)

@dezren39 dezren39 added queue/claimed Queue worker lifecycle state work/assigned Queue worker lifecycle state status/in-progress Queue worker lifecycle state labels Nov 14, 2026
…n protection (#7557)

Port of the original PR #8061 commit onto current main (task 17247): the target code moved from pkgs/id/src/web/markdown.rs to pkgs/id/crates/id-web/src/markdown/parse_helpers.rs in the crate split, and a rebase conflicted across the whole file, so the change was re-applied at the new location. protect_newline_destinations now only opens an inline code span when an equal-length backtick run closes it within the same paragraph (code_span_closes_within_paragraph), and resets span state at blank lines; an unmatched run stays literal per CommonMark and can no longer disable destination protection for the rest of the document. The #7557 regression test is ported unchanged. cargo test -p id-web --lib markdown: 293 passed, 0 failed.
@dezren39
dezren39 force-pushed the queue/14420-7557-code-span-blank-line branch from d5f133e to cda1587 Compare November 14, 2026 21:21
@dezren39
dezren39 merged commit 44a8d7c into main Nov 14, 2026
2 checks passed
@dezren39
dezren39 deleted the queue/14420-7557-code-span-blank-line branch November 14, 2026 21:21
@dezren39

Copy link
Copy Markdown
Member Author

Agent note — task 17247 done: fixed_merged (lane any-c)

@dezren39 dezren39 removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state work/assigned Queue worker lifecycle state labels Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant